<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:c="http://www.w3.org/1999/XSL/Transform">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="StyleSheet" href="../css/jpetstore.css" type="text/css" media="screen"/>
</head>
<body>
    <div th:replace="common/top">
    </div>

    <div id="Content">
        <div id="Catalog">
            <h2>订单一览</h2>

            <table class="altrowstable">
                <tr>
                    <td>OrderID</td>
                    <td>UserID</td>
                    <td>OrderDate</td>
                    <td>ShipCountry</td>
                    <td>TotalPrice</td>
                    <td>BillToLastname</td>
                    <td>ShipToLastName</td>
                    <td>Locale</td>
                    <td colspan="3">Operation</td>
                </tr>
                <tr th:each="order:${orderList}">
                    <td th:text="${order.orderid}">orderId</td>
                    <td th:text="${order.userid}">userId</td>
                    <td th:text="${order.orderdate}"></td>
                    <td th:text="${order.shipcountry}"></td>
                    <td th:text="${order.totalprice}"></td>
                    <td th:text="${order.billtolastname}"></td>
                    <td th:text="${order.shiptolastname}"></td>
                    <td th:text="${order.locale}"></td>
                    <td>
                        <a class="Button" th:href="'/order/view?orderid='+${order.orderid}">详细信息</a>
                        <a class="Button" th:href="'/order/edit?orderid='+${order.orderid}">修改订单</a>
                        <a class="Button"
                           title="已发货"
                           href ="javascript:return false;"
                           onclick="return false;"
                           style="cursor: default; opacity: 0.2"
                           th:if="${order.status} ne 'P'">发货完成
                        </a>
                        <a class="Button" th:href="'/order/orderSend?orderid='+${order.orderid}" th:if="${order.status} eq 'P'">订单发货</a>
                    </td>
                </tr>
            </table>
        </div>
    </div>

    <div th:replace="common/bottom">
    </div>
</body>